//package com.example.springboot.security.service;
//
//import org.springframework.security.core.authority.AuthorityUtils;
//import org.springframework.security.core.userdetails.User;
//import org.springframework.security.core.userdetails.UserDetails;
//import org.springframework.security.core.userdetails.UserDetailsService;
//import org.springframework.security.core.userdetails.UsernameNotFoundException;
//import org.springframework.security.crypto.password.PasswordEncoder;
//import org.springframework.stereotype.Service;
//
///**
// * @author lei yu
// * @date 2024/05/20
// */
//@Service
//public class MyUserDetailsService implements UserDetailsService {
//
//    private final PasswordEncoder encoder;
//
//    public MyUserDetailsService(PasswordEncoder encoder) {
//        this.encoder = encoder;
//    }
//
//
//    @Override
//    public UserDetails loadUserByUsername(String username) throws UsernameNotFoundException {
//        // 从数据库中，读取用户和密码
//        // ... ...
//
//        return new User("user",encoder.encode("123456"),
//                AuthorityUtils.commaSeparatedStringToAuthorityList("admin,user"));
//    }
//}
